Ext.define('iMedproplus.store.StructureTree', {
    extend: 'Ext.data.TreeStore', 

    requires: [
    'iMedproplus.model.StructureTree'
    ],
    
    autoLoad : true,
    constructor: function(cfg) {
        var me = this;
        cfg = cfg || {};
        me.callParent([Ext.apply({
                root : {
                    expanded: false
                },
            autoLoad : true,
            model: 'iMedproplus.model.StructureTree',
            proxy: {
                type: 'ajax',
                api: {
                    //create  : 'data/updatee.json',
                    read: '/imedproplus-rest/rest/json/organizationstructure/tree/get',
                        //'data/tree.json', 
                    update: '/imedproplus-rest/rest/json/organizationstructure/tree/add',
                    destroy : '/imedproplus-rest/rest/json/organizationstructure/tree/destroy'
                },
                reader: {
                    type: 'json'
                }
            }
        }, cfg)]);
    }
    
});